import request from '@/utils/request'
import {projectApiUrl} from '../config'
/**
 * 项目类型列表
 * @param parameter
 */
export function getProjectypesList(parameter){
  return request({
    url: projectApiUrl+'/projects/projectTypes',
    method: 'get',
    params: parameter
  })
}

/**
 * 查看项目类型详情
 * @param typeId
 */
export function getProjectypesOne(typeId){
  return request({
    url: projectApiUrl+'/projects/projectTypes/'+ typeId,
    method: 'get',
    typeId
  })
}

/**
 * 获取【风险条件】列表
 */
export function getRiskCondition(){
  return request({
    url: projectApiUrl+'/projects/risk-condition-select',
    method: 'get',
  })
}

/**
 * 新增项目类型
 * @param data
 */
export function addProjectypes(data){
  return request({
    url: projectApiUrl+'/projects/projectTypes',
    method: 'post',
    data: data
  })
}

/**
 * 项目类型删除
 * @param data
 */
export function delProjectypes(data){
  return request({
    url: projectApiUrl+'/projects/projectTypes/delete-type',
    method: 'post',
    data: data
  })
}

/**
 * 编辑项目类型
 * @param data
 */
export function editProjectypes(data){
  return request({
    url: projectApiUrl+'/projects/projectTypes/update',
    method: 'post',
    data: data
  })
}

/**
 * 计算方式
 * @param data
 */
export function getCalType(data){
  return request({
    url: projectApiUrl+'/projects/projectTypes/calculate-type',
    method: 'get',
    data: data
  })
}


